package edu.sctu.practice.class02.yangyuran.assign02;

/**
 * Created by Administrator on 2015/10/8.
 */
public class Rational {
    int a;
    int b;
    float c;

    public Rational(int a, int b) {
        this.a = a;
        this.b = b;
    }

    public void add() {
        c = a + b;
        System.out.println(c);
    }

    public void minus() {
        c = a - b;
        System.out.println(c);
    }

    public void multiply() {
        c = a * b;
        System.out.println(c);
    }

    public void divide() {
        c = a / b;
        System.out.println(c);
    }

    public static void main(String[] args) {
        Rational rational = new Rational(2, 5);
        Rational rational2 = new Rational(5, 2);

        rational.add();
        rational.minus();
        rational.multiply();
        rational.divide();

        rational2.add();
        rational2.minus();
        rational2.multiply();
        rational2.divide();
    }
}
